# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
pkgname=massif-visualizer
pkgver=0.7.0
pkgrel=3
pkgdesc="Visualizer for Valgrind Massif data files"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kde.org/applications/development/org.kde.massif-visualizer"
license="GPL-2.0-or-later"
makedepends="
	extra-cmake-modules
	karchive5-dev
	kconfig5-dev
	kcoreaddons5-dev
	kdiagram-dev
	ki18n5-dev
	kio5-dev
	kparts5-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qtxmlpatterns-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/massif-visualizer/$pkgver/src/massif-visualizer-$pkgver.tar.xz"
subpackages="$pkgname-lang"

build() {
	# The infowidget plugin is disabled due to an incompatibility with musl
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_INFOWIDGET_PLUGIN=FALSE
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="058412e34c0899a34fb4080a602cb0c70a9ac707f27b72a79fb412ea35a6e8c66ce06df15b3153fdc1a70a27232f98b508c7441b657eb73466962b33f9b2f561  massif-visualizer-0.7.0.tar.xz"
